

#pragma once

#include <vector>
using namespace std;

#include "../SGD Wrappers/CSGD_Direct3D.h"
#include "../SGD Wrappers/CSGD_TextureManager.h"

enum SpawnShape {RECTANGLE, CIRCLE, LINE};

struct Particle
	{
		float currPosY;
		float currPosX;
		int currAlpha;
		int currRColor;
		int currGColor;
		int currBColor;
		float currLife;
		float totalLife;
		float currRotation;
		float currScale;
		float currVelY;
		float currVelX;
	}; 

class Emitter
{
public:
	char mapName[20];
	//char filepath[100];
	string mapNameID;
	string filepath;
	std::vector<Particle> live;
	std::vector<Particle> dead;
	int imageID;
	int posY;
	int posX;
	int height;
	int width;
	SpawnShape emitterShape;
	int spread;
	int spawnRate;
	float direction;
	float AlphaStart;
	float RcolorStart;
	float GcolorStart;
	float BcolorStart;
	float AlphaEnd;
	float RcolorEnd;
	float GcolorEnd;
	float BcolorEnd;
	float scaleStart;
	float scaleEnd;
	float velocityYStart;
	float velocityXStart;
	float velocityYEnd;
	float velocityXEnd;
	float lifeMin;
	float lifeMax;
	float rotationStart;
	float rotationRate;
	int maxParticles;
	bool looping;

	CSGD_TextureManager		*m_pTM;


	Emitter(void);
	~Emitter(void);

	void Init();
	void Update(float fElapsedTime);
	void Render();
	void Exit();
	//bool LoadEmitter(string filePath);
	//void SaveEmitter(string filepath);
};

